const express = require("express");
const router = express.Router();
const {
  getJobs,
  getJob,
  createJob,
  removeJob,
  updateJob,
  showStats
} = require("../route-handlers/jobs");
const { jobsSchema } = require("../validator");

router.route("/").get(jobsSchema, getJobs).post(createJob);
router.route("/stats").get(showStats)
router.route("/:id").get(getJob).patch(updateJob).delete(removeJob);

module.exports = router;
